<template>
  <div>
    <van-goods-action>
      <van-goods-action-icon icon="shop-o" text="店铺"/>
      <van-goods-action-icon icon="chat-o" text="客服"/>
      <van-goods-action-icon icon="star-o" text="收藏"/>
      <van-goods-action-button type="warning" text="加入购物车" @click="addCart"/>
      <van-goods-action-button type="danger" text="立即购买"/>
    </van-goods-action>
  </div>
</template>

<script>
import Vue from 'vue';
import {GoodsAction, GoodsActionIcon, GoodsActionButton} from 'vant';
import { Toast } from 'vant';

Vue.use(Toast);
Vue.use(GoodsAction);
Vue.use(GoodsActionButton);
Vue.use(GoodsActionIcon);
export default {
  name: "goodsAction",
  props: {
    item: {
      type: Object,
    }
  },
  data(){
    return{

    };
  },
  methods: {
    addCart() {
      Toast('加入购物车成功');
      let it=this.item;
      let obj={};
      obj=it;
      obj.checked=false
      this.$store.commit('addCart', obj)
    },

  }
}
</script>

<style scoped>

</style>